package case2;

import java.util.Scanner;
class Dog implements Cloneable{
    private String name;
    private int age;

    public Dog(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return name;
    }
}
public class Demo{
    public static void main(String[] args) throws CloneNotSupportedException {
        Dog dog = new Dog("张三",15);
        Dog dog2 = (Dog) dog.clone();
        System.out.println(dog2.toString());
        System.out.println(dog.toString());
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Long l1 = scanner.nextLong();
        double change = Test.change(l1);
        System.out.printf("参数类型为Long，change方法返回值为%.2f\n",change);
        Long change1 = Test.change(l1.toString());
        System.out.printf("参数类型为String，change方法返回值为%d\n",change1);
        long change2 = Test.change(l1.longValue());
        System.out.printf("参数类型为long，change方法返回值为%d\n",change2);
    }
}